<%@ WebHandler Language="C#" Class="TreeHandler" %>

using System;
using System.Web;
using GridControl;//to use the TreeNode class
using System.Collections.Generic;
using System.Web.Script.Serialization;
public class TreeHandler : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        List<TreeNode> nodes = new List<TreeNode>();
        int ini = int.Parse(context.Request["node"].Replace("node",""));
        for (int i = ini+1; i < ini+10; i++)
        {
            TreeNode no = new TreeNode();
            no.draggable = true;
            no.id = i.ToString();
            no.text = "Node" + i;
            no.leaf = true;
            nodes.Add(no);
        }
        JavaScriptSerializer ser = new JavaScriptSerializer();
        context.Response.Write(ser.Serialize(nodes));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}